// 评价已完成组件
import styles from "@styles/room.module.scss";
import { StarFill, StarOutline } from "antd-mobile-icons";

interface Props {
  score: number | undefined;
}

export default function EvaluateComplete({ score }: Props) {
  return (
    <div className={styles.appraise}>
      <h4 className={styles.title}>感谢您对本次服务做出评价</h4>
      {typeof score === "number" && (
        <div className={styles.stars}>
          {Array.from({ length: 5 })
            .fill(1)
            .map((item, index) => {
              if (index <= score) {
                return <StarFill key={index} />;
              }
              return <StarOutline key={index} />;
            })}
        </div>
      )}
    </div>
  );
}